﻿@model MovingChame.Web.Models.Location

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Location</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LongDescription)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LongDescription)
            @Html.ValidationMessageFor(model => model.LongDescription)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ImagePath)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ImagePath)
            @Html.ValidationMessageFor(model => model.ImagePath)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Center)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Center)
            @Html.ValidationMessageFor(model => model.Center)
        </div>
        <div id='mapDiv' style="position:relative;" oncontextmenu="return false"></div>
        <input id="txtQuery" type="text" value="NTU, Singapore"/>
        <input type="button" value="Get Location" onclick="ClickGeocode()"/>   
        <input type="button" value="Create radius circle" onclick="CreateRadius()" />
        
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1")
    @Scripts.Render("~/Scripts/BingGetMap.js")
}
